blob: b564b48fc1cf65046ed0387550ecbb7093ac1121 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
import { PartnersBiddingDetail } from '@/lib/bidding/vendor/partners-bidding-detail'
import { Suspense } from 'react'
import { Skeleton } from '@/components/ui/skeleton'
import { getServerSession } from 'next-auth'
import { authOptions } from "@/app/api/auth/[...nextauth]/route"
interface PartnersBidDetailPageProps {
params: Promise<{
id: string
}>
}
export default async function PartnersBidDetailPage(props: PartnersBidDetailPageProps) {
const resolvedParams = await props.params
const biddingId = parseInt(resolvedParams.id)
if (isNaN(biddingId)) {
return (
<div className="container mx-auto py-6">
<div className="text-center">
<h1 className="text-2xl font-bold text-destructive">유효하지 않은 입찰 ID입니다.</h1>
</div>
</div>
)
}
// 세션에서 companyId 가져오기
const session = await getServerSession(authOptions)
const companyId = session?.user?.companyId
if (!companyId) {
return (
<div className="container mx-auto py-6">
<div className="text-center">
<h1 className="text-2xl font-bold text-destructive">회사 정보가 없습니다. 다시 로그인 해주세요.</h1>
</div>
</div>
)
}
console.log('biddingId:', biddingId)
console.log('companyId:', companyId)
return (
<div className="container mx-auto py-6">
<Suspense fallback={<BiddingDetailSkeleton />}>
<PartnersBiddingDetail
biddingId={biddingId}
companyId={companyId}
/>
</Suspense>
</div>
)
}
function BiddingDetailSkeleton() {
return (
<div className="space-y-6">
{/* 헤더 스켈레톤 */}
<div className="flex items-center justify-between">
<div className="space-y-2">
<Skeleton className="h-8 w-64" />
<Skeleton className="h-4 w-48" />
</div>
</div>
{/* 입찰 공고 스켈레톤 */}
<div className="space-y-4">
<Skeleton className="h-8 w-32" />
<div className="space-y-2">
{Array.from({ length: 6 }).map((_, i) => (
<Skeleton key={i} className="h-6 w-full" />
))}
</div>
</div>
{/* 제시된 조건 스켈레톤 */}
<div className="space-y-4">
<Skeleton className="h-8 w-32" />
<div className="space-y-2">
{Array.from({ length: 3 }).map((_, i) => (
<Skeleton key={i} className="h-12 w-full" />
))}
</div>
</div>
{/* 응찰 폼 스켈레톤 */}
<div className="space-y-4">
<Skeleton className="h-8 w-32" />
<div className="space-y-4">
{Array.from({ length: 8 }).map((_, i) => (
<Skeleton key={i} className="h-10 w-full" />
))}
<Skeleton className="h-12 w-32" />
</div>
</div>
</div>
)
}
|